<template>
    <div>
        <Modal v-model="modal" class="modal-full" title="单据预览" width="90%">
            <div v-if="modalShow">
                <grid-panel v-if="isParse" :model="parseModel" :hasCheck="true"></grid-panel>
            </div>
            <div slot="footer" class="button-panel-button">
                <i-button @click="close">返回</i-button>
            </div>
        </Modal>

    </div>
</template> 

<script>
import ModalBase from '../modalBase'
import $ from '@/common'
import GridPanel from '@/node/gridPanel'
import { billParser } from '@/common/parser'


export default {
    extends: ModalBase,
    props: {
    },
    data() {
        return {
            billModel: {},
            parseModel: {},
            isParse: false
        }
    },
    created() { },
    methods: {
        load() {
            this.isParse = false
            var path = this.actionModel.path || this.$parent.modelParam('path_find') || this.$parent.modelParam('path')
            $.link(path, null, {
                param: this.$parent.actionData
            }).then((res) => {
                this.billModel = res.data
                this.parseModel = billParser(res.data)
                this.isParse = true
            })
        }
    },
    components: {
        GridPanel
    }
}
</script>

<style lang="less">

</style>
